using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;


public partial class Admin_DiaDiemUpdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            tbDiaDiem  dd = tbDiaDiemBUS .GetByID(id);
            if (dd != null)
            {
                txt_madd .Text = dd.IDDiaDiem.ToString();
                txt_tendd .Text = dd.DiaDiem .ToString();

            }
        }
        catch
        {
            Response.Redirect("~/Admin/TrangThaiSPList.aspx");
        }
      
    }
    
    
    protected void btdd_update_Click(object sender, EventArgs e)
    {
        tbDiaDiem dd = new tbDiaDiem();
            dd.IDDiaDiem = int.Parse(txt_madd.Text);
            dd.DiaDiem = txt_tendd.Text;
            tbDiaDiemBUS.Update_DiaDiem(dd);
         Response.Redirect("~/Admin/DiaDiemList.aspx");
    }
    
}
        
  
        
